package com.ict.web.msg.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ict.web.msg.domain.SysMsg;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.time.LocalDateTime;

/**
 * 操作通知对象Vo
 *
 * @author xc
 */
@Data
@ApiModel(value = "操作通知对象Vo")
public class SysMsgVo
{
    @ApiModelProperty(value = "消息id")
    private String msgId;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "状态（0开放，1关闭）")
    private String msgStatus;

    @ApiModelProperty(value = "阅读标签（0未阅读，1已阅）")
    private String readFlag;

    @ApiModelProperty(value = "收件人id")
    private Long receiveUserId;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改人")
    private String updateBy;
    @ApiModelProperty(value = "消息类型0会议，1求购信息，2申报审批，3失物招领，4在线报修")
    private String resourceType;

    @ApiModelProperty(value = "关联资源id")
    private String resourceId;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "公告id")
    private Long noticeId;

    @ApiModelProperty(value = "附件id")
    private String noticeFileId;

    @ApiModelProperty(value = "公告附件名字")
    private String noticeFileName;

    @ApiModelProperty(value = "公告附件url")
    private String noticeFileUrl;

    @ApiModelProperty(value = "公告类型")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private String noticeType;

    @ApiModelProperty(value = "公告标题")
    private String noticeTitle;

    @ApiModelProperty(value = "公告内容")
    private String noticeContent;

    @ApiModelProperty(value = "年度计划Id")
    private Long planId;

    public static SysMsg of(SysMsgVo vo) {
        SysMsg bean=new SysMsg();
        BeanUtils.copyProperties(vo, bean);
        return bean;
    }
}
